/*
 * @Author: ray
 * @Date: 2021-09-02 16:15:48
 * @LastEditTime: 2024-06-10 11:44:57
 * @LastEditors: ray ray.chin@163.com
 * @Description: 主入口
 * @FilePath: /app-template-uni-upgrade/src/main.js
 */
import Vue from 'vue'
import App from './App'
import store from './store'

// 通用格式化css
import './static/css/common.css'

import Vconsole from 'vconsole'
// if (process.env.APP_ENV != "production") {
//     const vConsole = new Vconsole()
//     Vue.use(vConsole)
// }

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App,
	store,
})
app.$mount()

import api from '../api/api.js';
import rayTemplageApi from "./pagesRayTemplate/api/api.js";
Vue.prototype.$api = {
    ...api,
    ...rayTemplageApi,
}
Vue.use(api);

/**
 * 数字中间增加逗号
 * @param {Object} value
 */
Vue.filter('NumFormat', function(value) {
    if (!value) return '0';

    // 获取整数部分
    var intPart = Number(value).toFixed(0);
    // 将整数部分逢三一断
    var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');

    return intPartFormat;
});
